import "reflect-metadata"
import {createConnection} from 'typeorm'

import * as express from 'express'
import indexRouter from './routes/index'

createConnection()
.then(async conn =>{
    console.log('创建数据库连接成功')
    
    const app =  express()
    app.use('/',indexRouter)
    app.listen(8848,function(){
    console.log('app is runing and listening the 8848 port')
})
})
.catch(err=>{
    console.error('创建数据库连接失败',err)
})

